import sequelize from "../../db/dbConnext";
import { option } from "../../db/commomConfig";
import { DataTypes } from "sequelize";

import CodeGenerationEntity from "../../../entities/codeGeneration/CodeGenerationEntity";
export type ICodeGeneration = Omit<CodeGenerationEntity, "validateThis">;

const CodeGenerationModel = sequelize.define<any, ICodeGeneration>(
  "code_generation",
  {
    moduleName: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    fields: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    superDir: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    relationFile: {
      type: DataTypes.STRING,
      allowNull: true,
    },
    tableName: {
      type: DataTypes.STRING,
      allowNull: true,
    },
  },
  option
);
export default CodeGenerationModel;
